home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Online / Apache / include / php / ext / standard / php_output.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-23  |  3.0 KB  |  86 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | PHP version 4.0                                                      |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group                   |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 2.02 of the PHP license,      |
  8.    | that is bundled with this package in the file LICENSE, and is        |
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.php.net/license/2_02.txt.                                 |
  11.    | If you did not receive a copy of the PHP license and are unable to   |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@php.net so we can mail you a copy immediately.               |
  14.    +----------------------------------------------------------------------+
  15.    | Authors: Zeev Suraski <zeev@zend.com>                                |
  16.    +----------------------------------------------------------------------+
  17. */
  18.  
  19. /* $Id: php_output.h,v 1.16 2000/11/23 18:43:18 zeev Exp $ */
  20.  
  21. #ifndef PHP_OUTPUT_H
  22. #define PHP_OUTPUT_H
  23.  
  24. #include "php.h"
  25.  
  26. PHPAPI void php_output_startup(void);
  27. PHPAPI int  php_body_write(const char *str, uint str_length);
  28. PHPAPI int  php_header_write(const char *str, uint str_length);
  29. PHPAPI int php_start_ob_buffer(zval *output_handler, int chunk_size);
  30. PHPAPI void php_end_ob_buffer(int send_buffer);
  31. PHPAPI void php_end_ob_buffers(int send_buffer);
  32. PHPAPI int php_ob_get_buffer(pval *p);
  33. PHPAPI int php_ob_get_length(pval *p);
  34. PHPAPI void php_start_implicit_flush(void);
  35. PHPAPI void php_end_implicit_flush(void);
  36. PHPAPI char *php_get_output_start_filename(void);
  37. PHPAPI int php_get_output_start_lineno(void);
  38.  
  39. PHP_FUNCTION(ob_start);
  40. PHP_FUNCTION(ob_end_flush);
  41. PHP_FUNCTION(ob_end_clean);
  42. PHP_FUNCTION(ob_get_contents);
  43. PHP_FUNCTION(ob_get_length);
  44. PHP_FUNCTION(ob_implicit_flush);
  45.  
  46. PHP_GINIT_FUNCTION(output);
  47.  
  48. typedef struct _php_ob_buffer {
  49.     char *buffer;
  50.     uint size;
  51.     uint text_length;
  52.     int block_size;
  53.     zval *output_handler;
  54.     int chunk_size;
  55. } php_ob_buffer;
  56.  
  57. typedef struct _php_output_globals {
  58.     int (*php_body_write)(const char *str, uint str_length);        /* string output */
  59.     int (*php_header_write)(const char *str, uint str_length);    /* unbuffer string output */
  60.     php_ob_buffer active_ob_buffer;
  61.     unsigned char implicit_flush;
  62.     char *output_start_filename;
  63.     int output_start_lineno;
  64.     zend_stack ob_buffers;
  65.     int nesting_level;
  66.     zend_bool lock;
  67. } php_output_globals;
  68.  
  69.  
  70. #ifdef ZTS
  71. #define OLS_D php_output_globals *output_globals
  72. #define OLS_C output_globals
  73. #define OG(v) (output_globals->v)
  74. #define OLS_FETCH() php_output_globals *output_globals = ts_resource(output_globals_id)
  75. ZEND_API extern int output_globals_id;
  76. #else
  77. #define OLS_D void
  78. #define OLS_C
  79. #define OG(v) (output_globals.v)
  80. #define OLS_FETCH()
  81. ZEND_API extern php_output_globals output_globals;
  82. #endif
  83.  
  84.  
  85. #endif /* PHP_OUTPUT_H */
  86.